package com.yjhb.android.sbz.manager;

import androidx.annotation.ColorInt;
import androidx.annotation.StringRes;

import com.yjhb.android.sbz.App;
import com.yjhb.android.sbz.R;
import com.jojo.android.zxlib.tool.ZxTool;

/**
 * 创建者 zx
 * 创建时间 2020/12/15 9:40
 */
public class ResManager {
    private final String TAG = "ResManager";

    private static Integer themeColor;
    private static Integer dp;
    private static Integer normalTextSize;
    private static Integer TitleTextSize;


    public static String getString(@StringRes int id) {
        return App.getInstance().getResources().getString(id);
    }

    /**
     * 获得主题颜色
     *
     * @return
     */
    public static @ColorInt
    int getThemeColor() {
        if (themeColor == null) {
            themeColor = App.getInstance().getResources().getColor(R.color.colorPrimaryDark);
        }
        return themeColor;
    }

    /**
     * 获得一个单位的dp
     *
     * @return
     */
    public static int dp() {
        if (dp == null) {
            dp = ZxTool.dp2px(1);
        }
        return dp;
    }

}
